"""火山引擎的图片生成"""
from volcengine.visual.VisualService import VisualService


def generate_image():
    visual_service = VisualService()
    visual_service.set_ak("AKLTY2FhYTViM2VmNzQ0NGViOWI5MDNiN2Y5ZTA3Y2IzMzk")  # 替换为你自己的 AK
    visual_service.set_sk("TXpBMVlqVTJPVFkyTmpkaU5ERTVPRGt5WWpZMFlXSm1NakppT1dabE1tUQ==")  # 替换为你自己的 SK

    form = {
        "req_key": "jimeng_high_aes_general_v21_L",
        "prompt": "生成一张小猫图片",
        "return_url": True
    }

    resp = visual_service.cv_process(form)
    image_urls = resp.get('data', {}).get('image_urls', [])
    print(image_urls)


if __name__ == '__main__':
    # ['https://p26-aiop-sign.byteimg.com/tos-cn-i-vuqhorh59i/202510271750129BB16EF1C03F841DA13A-1025-0~tplv-vuqhorh59i-image-v1.image?rk3s=7f9e702d&x-expires=1761645019&x-signature=%2BLLFtOBtnTLQA4Oa9JoLDFZMc78%3D']
    generate_image()
